package com.atguigu.bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @Author:zwy
 * @Despriction:后置处理器 初始化前后进行处理
 * @Date:Create in 16:32 2018/7/7
 * @Modify By:
 */
@Component //加入到容器中
public class MysBeanPostProcessor  implements BeanPostProcessor{
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("postProcessBeforeInitialization------"+beanName+"==>"+bean);

        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("postProcessAfterInitialization------"+beanName+"==>"+bean);

        return bean;
    }
}
